<?php /** @noinspection ALL */


namespace app\admin\controller;


use think\facade\Db;

class Home {

	function index(){
		$system_user = Db::query("select count(id) as sum from system_user ");
		$user_num=$system_user[0]['sum'];//会员数

		$recharge_log=Db::query("select sum(number) as a from recharge_log ");
		$total_recharge=$recharge_log[0]['a']; //总充值

		$order_money=Db::query("select sum(pay_money) as a from option_order ");
		$total_order_money=$order_money[0]['a']; //总订单额

		$products=Db::query("select count(id) as a from option_products ");
		$products_num=$products[0]['a'];//产品数

		return json(['code' => 1, 'data' => [$user_num,$total_recharge,$total_order_money,$products_num] ]);
	}

}